package com.gk.carshopsys.utils;

import com.alibaba.excel.converters.Converter;

import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.gk.carshopsys.pojo.Car;



public class CarConverter implements Converter<Car> {

    @Override
    public Class supportJavaTypeKey() {
        return Car.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public WriteCellData<?> convertToExcelData(Car value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return new WriteCellData(value.getBrand()+value.getCarname()+value.getConfiguration()+value.getColor()+value.getType());
    }
}
